<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="../js/jquery-1.12.4.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<form action="index.html" method="post">
			姓名:<input type="text" name="name" /><br />
		密码:<input type="text" name="pass" /><br />
		确认密码:<input type="text" name="que" /><br />
			<input type="submit" value="提交"/>
		</form>
		<script type="text/javascript">
			$(function(){
				var info=$("<span stylr='color:gray'></span>")
				var suc=$("<span stylr='color:green'></span>")
				var err=$("<span stylr='color:red'></span>")
				info.html("姓名不能为空")
				$("[name='name']").after(info);
				var infopass=$("<span stylr='color:gray'>密码不能为空且不小于六位</span>")
				$("[name='pass']").after(infopass);
				var infoque=$("<span stylr='color:gray'>确认密码与密码一致</span>")
				$("[name='que']").after(infoque);
				$("[name='name']").blur(function(){
					var name=$(this).val()
					if(name==""){
						info.text("");
						err.text("")
						$("this").after("err")
					}
				})
				$("[name='name']").foucs(function(){
					info.html("姓名不能为空")
					err.html("")
					$(this).after(info)
				})
			})
		</script>
	</body>
</html>
